#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START diffstat

reset_mtime diffstat diffstat/configure.in
rm -rf build/diffstat
mkdir -p build/diffstat
cd build/diffstat

cat > config.cache <<-EOF
ac_cv_path_BZCAT=/bin/bzcat
ac_cv_path_BZIP2=/bin/bzip2
ac_cv_path_EGREP='grep -E'
ac_cv_path_FGREP='grep -F'
ac_cv_path_GROFF_PATH=no
ac_cv_path_NROFF_PATH=no
ac_cv_path_COMPRESS=/usr/bin/compress
ac_cv_path_GZIP=/bin/gzip
ac_cv_path_LZCAT=/usr/bin/lzcat
ac_cv_path_TBL_PATH=no
ac_cv_path_UNCOMPRESS=/usr/bin/uncompress
ac_cv_path_XZ=/usr/bin/xz
ac_cv_path_ZCAT=/bin/zcat
ac_cv_path_cf_man2html=no
EOF

../../diffstat/configure \
	${CONFIGURE_ARGS} \
	--cache-file=config.cache \
	${AUTOCRAP_KLUDGE}

make -j${JOBS}
make install DESTDIR=`pwd`/inst
cd inst
find ${prefix#/}/bin | cpio -pumd "${stage}"
cd ../../..
rm -rf build/diffstat

# RECIPE END diffstat
